export default class Dep {
    constructor() {
        this.subs = [];
    }
    add(sub) {
        this.subs.push(sub);
    }
    depend() {
        window.target && this.add(window.target);
    }
    notify() {
        const subs = this.subs.slice();
        for (const sub of subs) {
            sub.update();
        }
    }
}